<template>
  <div class="app">
    <div class="app-header">
      <div class="title-container">
        <div class="title-icon">🤖</div>
        <h1 class="main-title">AI教育卡片</h1>
        <div class="title-decoration"></div>
        <div class="tech-circles">
          <div class="circle"></div>
          <div class="circle"></div>
          <div class="circle"></div>
        </div>
      </div>
    </div>
    
    <div class="card-selection" v-if="!selectedCard">
      <div class="card-grid">
        <div 
          v-for="card in cardTypes" 
          :key="card.type"
          class="card-item"
          @click="selectCard(card.type)"
        >
          <div class="card-content">
            <div class="card-header">
              <div :class="['card-icon', card.icon]"></div>
              <div class="card-info">
                <div class="card-title">{{ card.title }}</div>
                <div class="card-desc">{{ card.description }}</div>
              </div>
            </div>
            <div class="card-tech-decoration">
              <div class="tech-line"></div>
              <div class="tech-dots">
                <span></span>
                <span></span>
                <span></span>
              </div>
            </div>
          </div>
          <div class="card-glow"></div>
        </div>
      </div>
    </div>
    
    <div class="chat-interface" v-else>
      <div class="chat-messages" ref="messagesContainer">
        <div 
          v-for="(message, index) in messages" 
          :key="index"
          :class="['message', message.type]"
        >
          <div v-if="message.categories" class="category-selection">
            <div 
              v-for="category in message.categories" 
              :key="category.key"
              class="category-item"
              @click="userInput = category.key; sendMessage()"
            >
              {{ category.value }}
            </div>
          </div>
          <div v-else class="message-content">{{ message.content }}</div>
        </div>
      </div>
      
      <div class="input-area" v-if="!messages[messages.length - 1]?.categories">
        <van-field
          v-model="userInput"
          :placeholder="getCurrentCardPlaceholder"
          :disabled="isGenerating"
          @keyup.enter="sendMessage"
        >
          <template #button>
            <van-button 
              size="small" 
              type="primary" 
              :loading="isGenerating"
              @click="sendMessage"
            >
              生成卡片
            </van-button>
          </template>
        </van-field>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, computed } from 'vue';
import { useRouter } from 'vue-router';

// 历史对照类别
const HISTORY_CATEGORIES = [
  '科技发展',
  '艺术发展',
  '哲学思想',
  '医学发展',
  '建筑发展'
];

const cardTypes = [
  {
    type: 'programming',
    title: '编程思维积木',
    description: '通过生活化的比喻，轻松理解编程概念',
    icon: 'icon-code',
    placeholder: '请输入编程概念，例如：循环、条件判断、顺序执行、变量、函数等'
  },
  {
    type: 'poem',
    title: '古诗词学习',
    description: '探索诗词的美丽世界',
    icon: 'icon-poem',
    placeholder: '请输入诗词名称，例如：静夜思、春晓、望庐山瀑布等'
  },
  {
    type: 'career',
    title: '职业体验站',
    description: '探索未来的职业世界',
    icon: 'icon-career',
    placeholder: '请输入职业名称，例如：宇航员、医生、建筑师、科学家等'
  },
  {
    type: 'history',
    title: '历史对照时间轴',
    description: '探索中西方历史发展',
    icon: 'icon-history',
    placeholder: '请选择历史类别：科技发展、艺术发展、哲学思想、医学发展、建筑发展'
  },
  {
    type: 'science',
    title: '科学探索',
    description: '发现科学的奇妙世界',
    icon: 'icon-science',
    placeholder: '请输入科学概念，例如：光合作用、重力、磁力、声音传播等'
  },
  {
    type: 'mbti',
    title: '高考职业测评',
    description: 'MBTI性格测试与职业匹配分析',
    icon: 'icon-mbti',
    placeholder: '点击开始MBTI职业测评'
  }
];

const selectedCard = ref(null);
const userInput = ref('');
const messages = ref([]);
const isGenerating = ref(false);
const messagesContainer = ref(null);
const router = useRouter();

const getCurrentCardPlaceholder = computed(() => {
  const card = cardTypes.find(c => c.type === selectedCard.value);
  return card?.placeholder || '请输入内容...';
});

const selectCard = (type) => {
  selectedCard.value = type;
  const card = cardTypes.find(c => c.type === type);
  
  if (type === 'history') {
    // 显示历史类别选择
    messages.value = [{
      type: 'system',
      content: '请选择要对比的历史类别：',
      categories: HISTORY_CATEGORIES.map(category => ({
        key: category,
        value: category
      }))
    }];
  } else if (type === 'mbti') {
    // 直接跳转到MBTI测试页面
    router.push({ name: 'MBTITest' });
  } else {
    messages.value = [{
      type: 'system',
      content: card.placeholder
    }];
  }
};

const sendMessage = async () => {
  if (!userInput.value.trim() || isGenerating.value) return;
  
  const input = userInput.value.trim();
  const cardType = selectedCard.value;
  
  console.log('开始生成卡片:', {
    cardType,
    input,
    timestamp: new Date().toISOString()
  });
  
  messages.value.push({
    type: 'user',
    content: input
  });
  
  userInput.value = '';
  isGenerating.value = true;
  
  let controller = null;
  let timeoutId = null;
  
  try {
    let parameters;
    if (cardType === 'history') {
      // 检查输入是否是有效的历史类别
      if (!HISTORY_CATEGORIES.includes(input)) {
        throw new Error('请选择有效的历史类别：科技发展、艺术发展、哲学思想、医学发展、建筑发展');
      }
      // 使用 category 参数
      parameters = { category: input };
    } else {
      parameters = { query: input };
    }
    
    console.log('准备发送API请求:', {
      cardType,
      parameters,
      timestamp: new Date().toISOString()
    });
    
    // 设置更长的超时时间（2分钟）
    controller = new AbortController();
    timeoutId = setTimeout(() => {
      if (controller) {
        console.warn('请求超时:', {
          cardType,
          input,
          timestamp: new Date().toISOString()
        });
        controller.abort('请求超时，请稍后重试');
      }
    }, 120000);
    
    const response = await fetch('/api/generate-card', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        cardType,
        parameters
      }),
      signal: controller.signal
    });
    
    // 请求成功后清除超时
    if (timeoutId) {
      clearTimeout(timeoutId);
      timeoutId = null;
    }
    
    console.log('收到API响应:', {
      status: response.status,
      statusText: response.statusText,
      cardType,
      timestamp: new Date().toISOString()
    });
    
    if (!response.ok) {
      let errorMessage = '生成卡片失败';
      try {
        const errorData = await response.json();
        errorMessage = errorData.error || errorMessage;
        console.error('API错误响应:', {
          cardType,
          error: errorData,
          timestamp: new Date().toISOString()
        });
      } catch (e) {
        console.error('解析错误响应失败:', {
          cardType,
          error: e,
          timestamp: new Date().toISOString()
        });
      }
      throw new Error(errorMessage);
    }
    
    let data;
    try {
      data = await response.json();
      console.log('解析API响应数据:', {
        cardType,
        success: data.success,
        hasData: !!data.data,
        timestamp: new Date().toISOString()
      });
    } catch (e) {
      console.error('解析响应数据失败:', {
        cardType,
        error: e,
        timestamp: new Date().toISOString()
      });
      throw new Error('服务器响应格式错误');
    }
    
    if (!data.success) {
      console.error('API返回失败:', {
        cardType,
        error: data.error,
        timestamp: new Date().toISOString()
      });
      throw new Error(data.error || '生成卡片失败');
    }
    
    // 保存卡片数据到 localStorage
    const cardData = {
      ...data.data,
      type: cardType,
      generatedAt: new Date().toISOString()
    };
    
    console.log('保存卡片数据:', {
      cardType,
      hasContent: !!cardData.content,
      timestamp: new Date().toISOString()
    });
    
    localStorage.setItem('currentCard', JSON.stringify(cardData));
    
    // 显示成功消息
    messages.value.push({
      type: 'system',
      content: '卡片生成成功！正在跳转到卡片页面...'
    });
    
    // 延迟跳转，让用户看到成功消息
    setTimeout(() => {
      try {
        console.log('准备跳转到卡片展示页面:', {
          cardType,
          timestamp: new Date().toISOString()
        });
        
        router.push({ name: 'CardView' }).then(() => {
          console.log('路由跳转成功:', {
            cardType,
            timestamp: new Date().toISOString()
          });
        }).catch(error => {
          console.error('路由跳转失败:', {
            cardType,
            error: {
              message: error.message,
              stack: error.stack
            },
            timestamp: new Date().toISOString()
          });
          messages.value.push({
            type: 'system',
            content: '跳转失败，请手动刷新页面查看卡片'
          });
        });
      } catch (error) {
        console.error('路由跳转出错:', {
          cardType,
          error: {
            message: error.message,
            stack: error.stack
          },
          timestamp: new Date().toISOString()
        });
        messages.value.push({
          type: 'system',
          content: `跳转失败: ${error.message}`
        });
      }
    }, 1000);
    
  } catch (error) {
    console.error('生成卡片失败:', {
      cardType,
      error: {
        name: error.name,
        message: error.message,
        stack: error.stack
      },
      timestamp: new Date().toISOString()
    });
    
    let errorMessage = error.message;
    
    if (error.name === 'AbortError') {
      errorMessage = error.message || '请求超时，请稍后重试';
    } else if (error.name === 'TypeError' && error.message.includes('Failed to fetch')) {
      errorMessage = '网络连接失败，请检查网络设置';
    }
    
    messages.value.push({
      type: 'system',
      content: errorMessage || '生成卡片失败，请稍后重试'
    });
  } finally {
    // 清理超时和控制器
    if (timeoutId) {
      clearTimeout(timeoutId);
    }
    controller = null;
    isGenerating.value = false;
    
    console.log('卡片生成流程结束:', {
      cardType,
      timestamp: new Date().toISOString()
    });
  }
};
</script>

<style lang="scss">
.app {
  min-height: 100vh;
  background: linear-gradient(135deg, #2a2a72 0%, #4a4a9a 50%, #3a3a82 100%);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  
  &::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
      radial-gradient(circle at 20% 20%, rgba(255, 105, 180, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 50% 50%, rgba(255, 255, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
  }
}

.app-header {
  padding: 20px 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
      transparent 0%,
      rgba(255, 0, 255, 0.1) 25%,
      rgba(0, 255, 255, 0.1) 50%,
      rgba(255, 255, 0, 0.1) 75%,
      transparent 100%
    );
    animation: headerGlow 8s linear infinite;
  }
}

.title-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 0 40px;
}

.title-icon {
  font-size: 32px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 0, 255, 0.5));
}

.main-title {
  font-size: 32px;
  font-weight: bold;
  background: linear-gradient(90deg, #ff00ff 0%, #00ffff 50%, #ffff00 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
  position: relative;
  animation: titleGlow 3s ease-in-out infinite;
  
  &::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ff00ff, #00ffff, #ffff00);
    animation: borderGlow 3s linear infinite;
  }
}

.tech-circles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  
  .circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: circleFloat 10s linear infinite;
    
    &:nth-child(1) {
      width: 100px;
      height: 100px;
      top: -50px;
      left: 20%;
      border-color: rgba(255, 0, 255, 0.2);
    }
    
    &:nth-child(2) {
      width: 150px;
      height: 150px;
      top: -75px;
      right: 20%;
      border-color: rgba(0, 255, 255, 0.2);
      animation-delay: -3s;
    }
    
    &:nth-child(3) {
      width: 80px;
      height: 80px;
      bottom: -40px;
      left: 50%;
      border-color: rgba(255, 255, 0, 0.2);
      animation-delay: -6s;
    }
  }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

@media (min-width: 1400px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) and (max-width: 1399px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .card-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

.card-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  height: 160px;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff69b4, #00ffff, #ffff00, #ff69b4);
    background-size: 300% 100%;
    animation: gradientMove 3s linear infinite;
  }
  
  &:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 
      0 16px 32px rgba(0, 0, 0, 0.15),
      0 0 16px rgba(255, 105, 180, 0.25),
      0 0 32px rgba(0, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
  }
}

.card-content {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.card-info {
  flex: 1;
  text-align: left;
  padding-top: 2px;
}

.card-icon {
  width: 44px;
  height: 44px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: #fff;
  
  &.icon-code {
    background-image: url('@/assets/icons/code.svg');
    filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.6));
    &:hover {
      filter: drop-shadow(0 0 16px rgba(0, 255, 255, 0.8));
    }
  }
  
  &.icon-poem {
    background-image: url('@/assets/icons/poem.svg');
    filter: drop-shadow(0 0 12px rgba(255, 105, 180, 0.6));
    &:hover {
      filter: drop-shadow(0 0 16px rgba(255, 105, 180, 0.8));
    }
  }
  
  &.icon-career {
    background-image: url('@/assets/icons/career.svg');
    filter: drop-shadow(0 0 12px rgba(255, 255, 0, 0.6));
    &:hover {
      filter: drop-shadow(0 0 16px rgba(255, 255, 0, 0.8));
    }
  }
  
  &.icon-history {
    background-image: url('@/assets/icons/history.svg');
    filter: drop-shadow(0 0 12px rgba(255, 69, 0, 0.6));
    &:hover {
      filter: drop-shadow(0 0 16px rgba(255, 69, 0, 0.8));
    }
  }
  
  &.icon-science {
    background-image: url('@/assets/icons/science.svg');
    filter: drop-shadow(0 0 12px rgba(0, 255, 0, 0.6));
    &:hover {
      filter: drop-shadow(0 0 16px rgba(0, 255, 0, 0.8));
    }
  }
  
  &.icon-mbti {
    background-image: url('@/assets/icons/mbti.svg');
    filter: drop-shadow(0 0 12px rgba(147, 112, 219, 0.6));
    &:hover {
      filter: drop-shadow(0 0 16px rgba(147, 112, 219, 0.8));
    }
  }
  
  &:hover {
    transform: scale(1.1);
  }
}

.card-title {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 105, 180, 0.4);
  margin-bottom: 10px;
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.9));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.card-desc {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  text-align: left;
  transition: color 0.3s ease;
  letter-spacing: 0.2px;
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, 
    rgba(255, 105, 180, 0.15) 0%,
    rgba(0, 255, 255, 0.15) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-tech-decoration {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.tech-line {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent,
    #ff69b4,
    #00ffff,
    #ffff00,
    transparent
  );
  animation: techLineMove 3s linear infinite;
  opacity: 0.8;
}

.tech-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  
  span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
    
    &:nth-child(1) { 
      background: #ff69b4;
      box-shadow: 0 0 12px rgba(255, 105, 180, 0.8);
    }
    &:nth-child(2) { 
      background: #00ffff;
      box-shadow: 0 0 12px rgba(0, 255, 255, 0.8);
    }
    &:nth-child(3) { 
      background: #ffff00;
      box-shadow: 0 0 12px rgba(255, 255, 0, 0.8);
    }
  }
}

.chat-interface {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  
  &::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, 
      rgba(255, 105, 180, 0.1) 0%,
      rgba(0, 255, 255, 0.1) 50%,
      transparent 100%
    );
    pointer-events: none;
    z-index: -1;
  }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.message {
  margin-bottom: 20px;
  max-width: 80%;
  
  &.system {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.4);
  }
  
  &.user {
    margin-left: auto;
    background: linear-gradient(90deg, #ff69b4 0%, #00ffff 100%);
    color: #fff;
    padding: 12px 20px;
    border-radius: 20px 20px 0 20px;
    box-shadow: 
      0 4px 12px rgba(255, 105, 180, 0.3),
      0 0 20px rgba(0, 255, 255, 0.3);
  }
}

.category-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.category-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  backdrop-filter: blur(5px);
  text-shadow: 0 0 10px rgba(255, 105, 180, 0.4);
  
  &:hover {
    background: linear-gradient(90deg, #ff69b4 0%, #00ffff 100%);
    box-shadow: 
      0 4px 12px rgba(255, 105, 180, 0.3),
      0 0 20px rgba(0, 255, 255, 0.3);
  }
}

.input-area {
  background: rgba(255, 255, 255, 0.1);
  padding: 16px;
  border-radius: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
      rgba(255, 105, 180, 0.1),
      rgba(0, 255, 255, 0.1)
    );
    border-radius: 24px;
    z-index: -1;
  }
  
  :deep(.van-field) {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px 16px;
    
    .van-field__control {
      font-size: 15px;
      color: #fff;
      
      &::placeholder {
        color: rgba(255, 255, 255, 0.6);
      }
    }
  }
  
  :deep(.van-button) {
    border-radius: 16px;
    background: linear-gradient(90deg, #ff69b4 0%, #00ffff 100%);
    border: none;
    padding: 0 24px;
    height: 36px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
    
    &:active {
      opacity: 0.9;
      transform: scale(0.98);
    }
  }
}

@keyframes headerGlow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes titleGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

@keyframes borderGlow {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

@keyframes circleFloat {
  0% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(180deg) translateY(-20px); }
  100% { transform: rotate(360deg) translateY(0); }
}

@keyframes techLineMove {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@media (max-width: 768px) {
  .title-container {
    padding: 0 20px;
  }
  
  .main-title {
    font-size: 24px;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 12px;
  }
  
  .card-item {
    height: 140px;
  }
  
  .card-content {
    padding: 16px;
  }
  
  .card-title {
    font-size: 20px;
  }
  
  .card-desc {
    font-size: 15px;
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
  }
  
  .chat-interface {
    padding: 12px;
  }
  
  .chat-messages {
    padding: 16px;
  }
  
  .message {
    max-width: 90%;
  }
}
.van-cell {
  border-radius: 15px;
}
</style> 